package tech.aistar.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.mapper.ProductTypeMapper;
import tech.aistar.model.entity.ProductType;
import tech.aistar.service.IProductService;
import tech.aistar.service.IProductTypeService;
import tech.aistar.util.MyBatisUtil;

import java.util.List;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/4/23 9:56 上午
 */
public class ProductTypeServiceImpl implements IProductTypeService {
    @Override
    public List<ProductType> findAll() {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        ProductTypeMapper productTypeMapper = sqlSession.getMapper(ProductTypeMapper.class);
        List<ProductType> list = productTypeMapper.findAll();
        MyBatisUtil.closeSqlSession(sqlSession);
        return list;
    }
}
